package com.community.process._1010.controller;

import com.community.process._1010.common.api.CommonResult;
import com.community.process._1010.dao.vo.ProcessingCouponTypeVo;
import com.community.process._1010.domains.ProcessingCouponTypeDTO;
import com.community.process._1010.service.ProcessingCouponTypeService;
import com.oneadds.lowcode.dto.PageListData;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 到餐
 */
@RestController
@Tag(name = "到餐加工食材")
@RequestMapping("/process")
@RequiredArgsConstructor
public class ProcessingCouponTypeController {

    private final ProcessingCouponTypeService processingCouponTypeService;

    @PostMapping("/getProcessingCouponTypeList.do")
    @Operation(summary = "获取食材列表")
    public CommonResult<PageListData<ProcessingCouponTypeVo>> getProcessingCouponTypeList(@RequestBody @Valid ProcessingCouponTypeDTO.ProcessingCouponTypeSearch dto) {
        PageListData<ProcessingCouponTypeVo> view = this.processingCouponTypeService.getProcessingCouponTypeList(dto);
        return CommonResult.success(view);
    }
}
